package com.vanvalt.payhui.modules.pay.service;

import org.apache.commons.lang3.StringEscapeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.thinkgem.jeesite.common.service.CrudService;
import com.vanvalt.core.utils.SvrUtils;
import com.vanvalt.payhui.modules.pay.dao.DownloadDao;
import com.vanvalt.payhui.modules.pay.entity.Download;

/**
 * @author Xiaoyang
 *
 */
@Service
@Transactional(readOnly = true)
public class DownloadService extends CrudService<DownloadDao, Download> {

	@Autowired
	public DownloadDao downloadDao;
	
	@Transactional(readOnly = false)
	public void save(Download download) {
		if (download.getComment() != null){
			download.setComment(StringEscapeUtils.unescapeHtml4(download.getComment()));
		}
		SvrUtils.save(download, downloadDao);
	}
}
